import React from 'react';
import { RouteObject } from 'react-router-dom';
import Layout from '@/layout';
import Main from '@/pages/main';
import Index from '@/pages/index';
import NotFound from '@/pages/NotFound';
import PMain from '@/pages/preview/main';
import PLayout from '@/layout/preview';
import PThree from '@/pages/preview/three';
import PThreeSimulation from '@/pages/preview/three/simulation';
import WikiPage from '@/pages/wiki';

const BaseURL = process.env.NODE_ENV === 'production' ? '/providen-craft-website' : '';

export default [
  {
    path: BaseURL + '/',
    element: <Layout />,
    children: [
      {
        index: true,
        element: <Index />,
        children: [],
      },
      {
        path: 'preview',
        element: <PLayout />,
        children: [
          {
            index: true,
            element: <PMain />,
          },
          {
            path: 'three',
            element: <PThree />,
          },
          {
            path: 'simulation',
            element: <PThreeSimulation />,
          },
        ],
      },
      {
        path: 'wiki',
        element: <WikiPage />,
      },
    ],
  },
  {
    path: '/*',
    element: <NotFound />,
  },
] as RouteObject[];
